<?php
	$job = new Job($id);
	if ($extra != '' && $extra == $job->GetAuth())
	{
		$later_edit = true;
		$_SESSION['later_edit'] = $extra;
	}
	else
	{
		$later_edit = false;
		$_SESSION['later_edit'] = '';
	}
	
	if ($_SESSION['referer'] != BASE_URL . 'post/')
	{
		if (!$_SESSION['later_edit'])
		{
			redirect_to(BASE_URL . 'realestate/' . $id . '/');
			exit;
		}
	}
	
	$jobs = $job->GetInfo();
	
	//print_r($jobs);
	if (strstr($jobs['description'], '*'))
	{
		$jobs['description'] = $textile->TextileThis($jobs['description']);	
	}
	else
	{
		//$jobs['description'] = nl2br($jobs['description']);
		$jobs['description'] = str_replace(array("\r\n", "\r", "\n"), "<br />", $jobs['description']);
	}
	//
		$smarty->assign('types', get_types());
			$smarty->assign('property_array',$property_array);	
	$smarty->assign('property_array2',$property_array2);
	
		///////////////////
		$sql = "SELECT property_city_list.id as sid, property_city_list.gamearea as gamearea,property_state_list.gamename gname
						FROM property_city_list LEFT JOIN property_state_list
						ON (property_state_list.id = property_city_list.gameid)
						WHERE property_city_list.isgamearea=1";
	$comps = $db->QueryArray($sql);
	
	$state_array=array();						
	$city_array=array();						
	foreach ($comps as $companya)
	{
		$sid = $companya['sid'];
		$city_array[$sid] = $companya['gamearea'];	 
		$state_array[$sid] = $companya['gname'];	
	}
	
	//print_r($city_array);
	$smarty->assign('city_array', $city_array);
	$smarty->assign('state_array', $state_array);
	
	
	$smarty->assign('job', $jobs);
	$html_title = stripslashes($jobs['title']) . ' la ' . stripslashes($jobs['company']) . ' / ' . SITE_NAME;
	$template = 'publish-verify.tpl';
?>